{% extends 'base.html' %} {% load staticfiles %} {% block title %}DWDM:{{ dwdm.name }}{% endblock %} {% block content %}
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>DWDM详细</h1>
  <ol class="breadcrumb">
    <li><a href="{% url 'index' %}"><i class="fa fa-dashboard"></i> 主页</a></li>
    <li>资产总表</li>
    <li class="active">DWDM详细</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">

  <!-- Default box -->
  <div class="box">
    <div class="box-body">
      <div class="nav-tabs-custom">
        <ul class="nav nav-tabs">
          <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="false">基本信息</a></li>
          <li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false">波道信息</a></li>
          <li class=""><a href="#tab_3" data-toggle="tab" aria-expanded="false">更新日志</a></li>
        </ul>
        <div class="tab-content">
          <div class="tab-pane active" id="tab_1">
            <div class="row">
              <div class="col-xs-2 text-right">DWDM名称:</div>
              <div class="col-xs-4">{{ dwdm.name }}</div>
              <div class="col-xs-2 text-right">型号:</div>
              <div class="col-xs-4">{{ dwdm.modelnumber|default:'' }}</div>
            </div>
            <br>
            <div class="row">
              <div class="col-xs-2 text-right">厂商:</div>
              <div class="col-xs-4">{{ dwdm.manufacturer|default:'' }}</div>
              <div class="col-xs-2 text-right">设备高度(U):</div>
              <div class="col-xs-4">{{ dwdm.high|default:'' }}</div>
            </div>
            <br>
            <div class="row">
              <div class="col-xs-2 text-right">状态:</div>
              <div class="col-xs-4">{{ dwdm.get_status_display }}</div>
              <div class="col-xs-2 text-right">业务线:</div>
              <div class="col-xs-4">{{ dwdm.get_business_unit_display }}</div>
            </div>
            <br>
            <div class="row">
              <div class="col-xs-2 text-right">合波器:</div>
              <div class="col-xs-4">{{ dwdm.mux|default:'' }}</div>
              <div class="col-xs-2 text-right">BA放大器:</div>
              <div class="col-xs-4">{{ dwdm.ba|default:'' }}</div>
            </div>
            <br>
            <div class="row">
              <div class="col-xs-2 text-right">PA放大器:</div>
              <div class="col-xs-4">{{ dwdm.pa|default:'' }}</div>
              <div class="col-xs-2 text-right">色散补偿:</div>
              <div class="col-xs-4">{{ dwdm.dcm|default:'' }}</div>
            </div>
            <br>
            <div class="row">
              <div class="col-xs-2 text-right">OEO:</div>
              <div class="col-xs-4">{{ dwdm.get_oeo_display }}</div>
              <div class="col-xs-2 text-right">OLP:</div>
              <div class="col-xs-4">{{ dwdm.get_olp_display }}</div>
            </div>
            <br>
            <div class="row">
              <div class="col-xs-2 text-right">起始端机房:</div>
              <div class="col-xs-4">{{ dwdm.machineroom_a|default:'' }}</div>
              <div class="col-xs-2 text-right">终止端机房:</div>
              <div class="col-xs-4">{{ dwdm.machineroom_z|default:'' }}</div>
            </div>
            <br>
            <div class="row">
              <div class="col-xs-2 text-right">起始端机架:</div>
              <div class="col-xs-4">{{ dwdm.cabinet_a|default:'' }}</div>
              <div class="col-xs-2 text-right">终止端机架:</div>
              <div class="col-xs-4">{{ dwdm.cabinet_z|default:'' }}</div>
            </div>
            <br>
            <div class="row">
              <div class="col-xs-2 text-right">起始端设备固资:</div>
              <div class="col-xs-4">{{ dwdm.device_a_number|default:'' }}</div>
              <div class="col-xs-2 text-right">终止端设备固资:</div>
              <div class="col-xs-4">{{ dwdm.device_z_number|default:'' }}</div>
            </div>
            <br>
            <div class="row">
              <div class="col-xs-2 text-right">维护人:</div>
              <div class="col-xs-4">{{ dwdm.maintainer|default:'' }}</div>
              <div class="col-xs-2 text-right">备注:</div>
              <div class="col-xs-4">{{ dwdm.memo|default:'' }}</div>
            </div>
            <br>
            <p style=" margin:0 auto; text-align:center;">
              <button class="btn btn-default " align="center" data-toggle="modal" data-target="#dwdmEditModal">修改</button>
            </p>
            <br>
            <h4><b>DWDM底层裸纤:</b></h4>
            <table border="1" class="table  table-responsive" style="solid">
              <thead>
                <tr>
                  <th>专线名称</th>
                  <th>专线编号:</th>
                  <th>运营商</th>
                </tr>
              </thead>
              <tbody>
                {% for circuit in circuit %}
                <tr>
                  <td><a href="{% url 'circuitdetail' circuit.id %}" target=_blank>{{ circuit.name|default:'N/A' }}</a></td>
                  <td>{{ circuit.number|default:'N/A' }}</td>
                  <td>{{ circuit.isp|default:'N/A' }}</td>
                </tr>
                {% empty %}
                <tr>底层裸纤未关联！</tr>
                {% endfor %}
              </tbody>
            </table>
          </div> 
          <form class="form-horizontal" action="{% url 'dwdmdetail' dwdm.id %}" method="post">
            {% csrf_token %}
            <div class="modal fade" id='dwdmEditModal' tabindex="-1" role="dialog" aria-labelledby='myModelLabel' aria-hidden="true">
              <div class="modal-dialog modal-lg">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">DWDM修改</h4>
                  </div>
                  <div class="modal-body">
                    <form class="form-horizontal" role="form">
                    <div class="form-group">
                      <label for="modify" class="col-sm-2 control-label">DWDM名称:</label>
                      <div class="col-sm-8">
                        <input type="text" class="form-control" type="text" name='name' value= {{ dwdm.name|default:'' }}>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="modify" class="col-sm-2 control-label">型号:</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='modelnumber' value= {{ dwdm.modelnumber|default:'' }}>
                      </div>
                      <label for="modify" class="col-sm-2 control-label">厂商:</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='manufacturer' value= {{ dwdm.manufacturer|default:'' }}>
                      </div>  
                    </div>
                    <div class="form-group">
                      <label for="modify" class="col-sm-2 control-label">设备高度(U):</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='high' value= {{ dwdm.high|default:'' }}>
                      </div>
                      <label for="modify" class="col-sm-2 control-label">合波器:</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='mux' value= {{ dwdm.mux|default:'' }}>
                      </div>  
                    </div>
                    <div class="form-group">
                      <label for="modify" class="col-sm-2 control-label">状态:</label>
                      <div class="col-sm-3">
                        <select class="selector input-sm" name='status'>
                          <option value='0' {% if dwdm.status == 0 %} selected="selected" {% endif %}>运营</option>
                          <option value='1' {% if dwdm.status == 1 %} selected="selected" {% endif %}>拆除</option>
                          <option value='2' {% if dwdm.status == 2 %} selected="selected" {% endif %}>待启用</option>
                        </select>
                      </div>
                      <label for="modify" class="col-sm-2 control-label">业务线:</label>
                      <div class="col-sm-3">
                        <select class="selector input-sm" name='business_unit'>
                          <option value='0' {% if dwdm.business_unit == 0 %} selected="selected" {% endif %}>领骏</option>
                          <option value='1' {% if dwdm.business_unit == 1 %} selected="selected" {% endif %}>驰联</option>
                        </select>
                      </div>  
                    </div>
                    <div class="form-group">
                      <label for="modify" class="col-sm-2 control-label">BA放大器:</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='ba' value= {{ dwdm.ba|default:'' }}>
                      </div>
                      <label for="modify" class="col-sm-2 control-label">PA放大器:</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='pa' value= {{ dwdm.pa|default:'' }}>
                      </div>  
                    </div>
                    <div class="form-group">
                      <label for="modify" class="col-sm-2 control-label">色散补偿:</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='dcm' value= {{ dwdm.dcm|default:'' }}>
                      </div>
                      <label for="modify" class="col-sm-2 control-label">OEO:</label>
                      <div class="col-sm-3">
                        <select class="selector input-sm" name='oeo'>
                          <option value='0' {% if dwdm.oeo == 0 %} selected="selected" {% endif %}>是</option>
                          <option value='1' {% if dwdm.oeo == 1 %} selected="selected" {% endif %}>否</option>
                        </select>
                      </div>  
                    </div>
                    <div class="form-group">
                      <label for="modify" class="col-sm-2 control-label">OLP:</label>
                      <div class="col-sm-3">
                        <select class="selector input-sm" name='olp'>
                          <option value='0' {% if dwdm.olp == 0 %} selected="selected" {% endif %}>是</option>
                          <option value='1' {% if dwdm.olp == 1 %} selected="selected" {% endif %}>否</option>
                        </select>
                      </div>
                      <label for="modify" class="col-sm-2 control-label">维护人:</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='maintainer' value= {{ dwdm.maintainer|default:'' }}>
                      </div>  
                    </div>
                    <div class="form-group">
                      <label for="modify" class="col-sm-2 control-label">起始端机房:</label>
                      <div class="col-sm-3">
                         <select class="form-control" id='machineroom' name='machineroom_a'>
                           <option value='' {% if dwdm.machineroom_a == '' %} selected="selected" {% endif %}>请选择</option>
                           {% for machineroom in machineroom %}
                           <option value={{ machineroom }}  {% if dwdm.machineroom_a == machineroom %} selected="selected" {% endif %}>{{ machineroom }}</option>
                           {% endfor %}
                         </select>
                      </div>
                      <label for="modify" class="col-sm-2 control-label">终止端机房:</label>
                      <div class="col-sm-3">
                         <select class="form-control" id='machineroom' name='machineroom_z'>
                           <option value='' {% if dwdm.machineroom_z == '' %} selected="selected" {% endif %}>请选择</option>
                           {% for machineroom in machineroom %}
                           <option value={{ machineroom }}  {% if dwdm.machineroom_z == machineroom %} selected="selected" {% endif %}>{{ machineroom }}</option>
                           {% endfor %}
                         </select>
                      </div>  
                    </div>
                    <div class="form-group">
                      <label for="modify" class="col-sm-2 control-label">起始端机架:</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='cabinet_a' value= {{ dwdm.cabinet_a|default:'' }}>
                      </div>
                      <label for="modify" class="col-sm-2 control-label">终止端机架:</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='cabinet_z' value= {{ dwdm.cabinet_z|default:'' }}>
                      </div>  
                    </div>
                    <div class="form-group">
                      <label for="modify" class="col-sm-2 control-label">起始端设备固资:</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='device_a_number' value= {{ dwdm.device_a_number|default:'' }}>
                      </div>
                      <label for="modify" class="col-sm-2 control-label">终止端设备固资:</label>
                      <div class="col-sm-3">
                        <input type="text" class="form-control" type="text" name='device_z_number' value= {{ dwdm.device_z_number|default:'' }}>
                      </div>  
                    </div>
                    <div class="form-group">  
                      <label for="modify" class="col-sm-2 control-label">备注:</label>
                      <div class="col-sm-8">
                        <input type="text" class="form-control" type="text" name='memo' value= {{ dwdm.memo|default:'' }}>
                      </div>  
                    </div>
                    <div class="form-group">
                      <label for="modify" class="col-sm-2 control-label">修改原因:<font color='#ff0000'>*</font></label>
                      <div class="col-sm-8">
                        <input type="text" class="form-control" type="textarea" name='reason' required>
                      </div>
                    </div>
                    </form>
                  </div>  
                  <div class="modal-footer">
                    <button type="submit" name="submit" value="dwdm_edit" class="btn btn-primary">确认</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                  </div>
                </div>
              </div>
            </div>
          </form>

          <!-- /.tab-pane tab_1 -->
          <div class="tab-pane" id="tab_2">
            <table id="dwdm_channel_table" border="1" class="display table table-bordered table-striped">
              <thead>
              <tr>
                <th>波道名称</th>
                <th>DWDM</th>
                <th>状态</th>
                <th>客户</th>
                <th>起始端设备</th>
                <th>起始端设备端口</th>
                <th>终止端设备</th>
                <th>终止端设备端口</th>
                <th>备注</th>
              </tr>
              </thead>
              <tbody>
                  {% for channel in channel %}
                  <tr>
                    <td><a href="{% url 'channeldetail' channel.id %}" target=_blank >{{ channel.name }}</td>
                    <td>{{ channel.dwdm|default:'' }}</td> 
                    <td>{{ channel.get_status_display }}</td>
                    <td>{{ channel.customer|default:'' }}</td>
                    <td>{{ channel.networkdevice_a.hostname|default:'' }}</td>                
                    <td>{{ channel.port_a|default:'' }}</td>
                    <td>{{ channel.networkdevice_z.hostname|default:'' }}</td>
                    <td>{{ channel.port_z|default:'' }}</td>
                    <td>{{ channel.memo|default:'' }}</td>
                  </tr>
                  {% empty %}
                    <tr>没有数据！</tr>
                  {% endfor %}
              </tbody>
            </table>
            <a href="{% url 'assetimport' '波道' %}" target=_blank>
            <button type="submit" class="btn btn-default pull-right " >波道导入</button>
            </a>
            <br>
            <br>
          </div>
          <!-- /.tab-pane tab_2 -->
          <div class="tab-pane" id="tab_3">
            <h4><b>日志信息:</b></h4>
            <table id="eventlog_table" border="1" class="display table table-bordered table-striped">
              <thead>
                <tr>
                  <th>类型</th>
                  <th>详细内容</th>
                  <th>操作原因</th>
                  <th>操作时间</th>
                  <th>操作人</th>
                </tr>
              </thead>
              <tbody>
                {% for log in eventlog %}
                <tr>
                  <td id="log_event_type">{{ log.get_event_type_display }}</td>
                  <td id="log_detail">{{ log.detail }}</td>
                  <td id="log_reason">{{ log.reason }}</td>
                  <td id="log_date">{{ log.date|date:"Y-m-d H:i:s" }}</td>
                  <td id="log_user">{{ log.user }}</td>
                </tr>
                {% empty %}
                <tr>没有日志信息！</tr>
                {% endfor %}
              </tbody>
            </table>
          </div>
          <!-- /.tab-pane tab_3 -->
        </div>
      </div>
    </div>
    <!-- /.box-body -->
    <div class="box-footer">
      <i class="fa fa-angle-double-left"></i>&nbsp;&nbsp;<a href="{% url 'index' %}"><strong>返回资产列表页</strong></a>
    </div>
    <!-- /.box-footer-->
  </div>
  <!-- /.box -->

</section>
<!-- /.content -->
{% endblock %}
